package com.example.springbootdemo1.Controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
public class TestController {
    //1.得到日志对象
    private static final Logger log = LoggerFactory.getLogger(TestController.class);
    //2.实现日志的打印
@RequestMapping("/sayhe")
    public String sayHi() {
        log.debug("i am debug");
        log.error("i am error");
        log.info("i am info");
        log.trace("i am trace");
        return "hello,world";
    }
}
